<template>
    <div class=''>
        <div class="title">
            <img style="height: 30px; width: 30px; margin-left: 10px;" src="@/assets/menuListLogo/com.jingdong.app.mall.png">
            <span style="padding-left: 10px;">京东</span>
        </div>
        <gpsDetail :position="position" v-if="isShow"></gpsDetail>
    </div>
</template>

<script>
import { getXYDetailApi } from '@/api/addApp/jingDong_api'
import gpsDetail from '../../map/gps.vue'
export default {
    name: 'jingDong',
    props: ['sendData'],
    data() {
        return {
            XYDetail: [],
            offset: 1,
            limit: 20,
            position:{},
            isShow:false
        };
    },
    components: {
        gpsDetail,
    },
    created() {
        this.getXYDetail();
    },
    mounted() {
    },
    methods: {
        async getXYDetail() {
            let data = {
                proof_num: this.sendData.proof_num,
                offset: this.offset,
                limit: this.limit
            }
            try {
                let list = await getXYDetailApi(data)
                if(list.data){
                    this.XYDetail = list.data;
                    this.position = {
                        title: '',
                        _x:Number(this.XYDetail[0].x),
                        _y:Number(this.XYDetail[0].y),
                    }
                    this.isShow=true
                }
            } catch (error) {
                console.error(error)
            }
        }
    },
};
</script>
<style lang='scss' scoped>
.title {
    height: 50px;
    background-color: #2b2f3a;
    margin-bottom: 10px;
    font-size: 15px;
    color: #fff;
    display: flex;
    align-items: center;
}
</style>